/**
    [Filename]
    Purpose: [Purpose]

    @author Jason Wojcik
    @version [version]
*/

#include "CApp.h"

//constructor
CApp::CApp(){

    //Screen surface initialization
    Surf_Display = NULL;

    fontColor = {255,255,255};  //white

    //set the game status to true
    Running = true;
}


//game function
int CApp::OnExecute(){
    //set up everything
    if(!OnInit()) return -1;

    SDL_Event Event;

    //game loop
    while(Running){
        while(SDL_PollEvent(&Event)){
            OnEvent(&Event);
        }

        //game logic
        OnLoop();

        //render function
        OnRender();
    }

    //cleanup
    OnCleanup();

    return 0;
}


//program main function
int main(int argc, char* argv[]){
    CApp theApp;

    return theApp.OnExecute();
}
